from sys import path as path2

import jieba

path2.append('c:/users/tian/desktop')
from Service import service

service.path = 'd:/data/taosebt.db'
with open('d:/data/whitelist.txt', 'r', encoding='utf-8') as f:
    keys = f.read().split()
for key in keys:
    results = service.query('select title, url, magnet from guochan where title like ?', (f'%key%',))
    print(key, len(results))

#     l = jieba.lcut(result)
#     for s in l:
#         d[s] = d.get(s, 0) + 1
# l = list(d.items())
# l.sort(key=lambda t: t[1])
# print(l)
